import { ref } from 'vue'
import request from '@/utils/request.js'
// 获取视频列表
export const getVideoListService = (sectionId) => {
    return request.get('/video/selectVideoList/' + sectionId)
}


// 获取视频进度百分比
export const getVideoJdList = (videoId) => {
    return request.get('/video/selectVideoJd?videoId=' + videoId)
}

// 新增视频进度百分比
export const addVideoJd = (videoId) => {
    return request.post('/video/updateVideoJd?videoId=' + videoId)
}

//存储视频进度百分比
export const insertVideoJd = (videoId, videoJd) => {
    return request.post('/video/insertRedis?videoId=' + videoId + '&videoJd=' + videoJd)
}
//模糊查询视频
export const selectVideoListByNameService = (videoName, courseId) => {
    return request.get('/video/selectVideo/' + videoName + '/' + courseId)
}

//课程编号查询视频数量
export const selectVideoCountService = (courseId) => {
    return request.get('/video/getVideoNum?courseId=' + courseId)
}
//获取视频进度
export const getVideoJdService = (userId, videoId) => {
    return request.get('/video/getVideoJd/' + userId + '/' + videoId)
}

export const selectUserInfo = () => {
    return request.get('/user/select')
}

export const selectVideoPath = (videoId) => {
    return request.get('/video/getVideoPath?videoId=' + videoId)
}